function doSearch() {
	$('#tt').datagrid('load', {
	});
	$('#tt').datagrid('unselectAll');
}


function add() {
	showMyWindow('新增', '/miguUsefulConfig/addConfig', 800, 600);
}

function edit() {
	var row = $('#tt').datagrid('getSelected');
	if (row) {
		showMyWindow('编辑', '/miguUsefulConfig/' + row.id + '/configUpdate', 800, 600);
	} else {
		showMsg(market.content.title, market.content.tips, alert);
	}
}

function del() {
	var row = $('#tt').datagrid('getSelected');
	$.messager.confirm('温馨提醒', '你确定删除本条数据吗？', function(r) {
		if (r) {
			$.get('/miguUsefulConfig/del?id=' + row.id, function(data) {
				if (data.return_code == '1') {
					top.showMsg(market.content.title, data.return_msg, alert);
					doSearch();
				} else if (data.return_code == '3') {
					top.showMsg(market.content.title, data.return_msg, alert);
				} else {
					$.messager.alert(market.content.title, data.return_msg);
				}
			});
		}
	});
}


